<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title><spring:message code="slopwork_stock_list" /><</title>
    <%@ include file="/WEB-INF/views/include/head.jsp"%>
    <script src="${ctxStatic}/js/jquery-1.9.1.min.js"></script>
    <script src="${ctxStatic}/js/DateTimePicker.js"></script>
    <script src="${ctxStatic}/js/layer.js"></script>
    <script src="${ctxStatic}/js/style.js"></script>
    <script src="${ctxStatic}/dateCalendar/WdatePicker.js"></script>
    <link rel="stylesheet" href="${ctxStatic}/css/common_erp.css">
    <link rel="stylesheet" href="${ctxStatic}/css/list.css">
    <script>
        $(document).ready(function() {
            $("select").select2();
            searchListForm();
        });

        //检索
        function searchListForm() {
            var styleNo = $("#styleNo").val();
            var ognizationName = $("#ognizationName").val();
            var styleCateGoryCd = $("#styleCateGoryCd").val();
            var dateFrom = $("#dateFrom").val();
            var dateTo = $("#dateTo").val();
            var userId = $("#userId").val();
            $("#activity_pane").showLoading();
            $.post("${ctx}/slopwork/stock/searchList?styleNo=" + styleNo + "&ognizationName=" + ognizationName
                    + "&styleCateGoryCd=" + styleCateGoryCd + "&dateFrom=" + dateFrom + "&dateTo=" + dateTo,"", function(result) {
                var listHtml = result["slopworkStock"];
                var pageHtml = result["page"];
                $("#listHtml").html(listHtml);
                $("#paging").html(pageHtml);
                $("#activity_pane").hideLoading();
            }, 'json');
        }

        //重置
        function clearParam() {
            $("#styleNo").val("");
            $("#ognizationName").val("");
            $("#styleCateGoryCd").find("option")[0].selected = true
            // 下拉选框带搜索功能
            $("#styleCateGoryCd").select2();;
            var dateFrom = $("#dateFrom").val("");
            var dateTo = $("#dateTo").val("");
            var userId = $("#userId").val("");
            searchListForm();
        }
    </script>
</head>
<body>
<div class="listArea" id="activity_pane">
    <div class="listBg">
        <div class="searchArea clearfix">
            <div class="searchLeft clearfix">
                <div class="searchInp clearfix">
                    <!-- 款号 -->
                    <p>
                        <spring:message code="bigcargo_model_no" />
                    </p>
                    <input class="w-styleNub" id="styleNo" name="styleNo">
                </div>
                <div class="searchInp clearfix">
                    <!-- 客户 -->
                    <p>
                        <spring:message code="bigcargo_customer" />
                    </p>
                    <input class="w-customer" id="ognizationName"
                           name="ognizationName">
                </div>
                <div class="searchInp clearfix">
                    <!-- 款式类别 -->
                    <p>
                        <spring:message code="bigcargo_style_model" />
                    </p>
                    <select class="w-styleCategory" id="styleCateGoryCd"
                            name="styleCateGoryCd" style="width: 150px">
                        <option value=""><spring:message
                                code="order_please_choose" /></option>
                        <c:forEach items="${styleList}" var="item">
                            <option value="${item.itemCode}-${item.itemValue}">${item.itemName}</option>
                        </c:forEach>
                    </select>
                </div>
                <div class="searchInp clearfix">
                    <!-- 日期 -->
                    <p>
                        <spring:message code="bigcargo_date" />
                    </p>
                    <div class="timeBox">
                        <input type="text" class="laydate-icon" onclick="WdatePicker({el:this,dateFmt:'yyyy-MM-dd',onpicked:null})"
                               id="dateFrom" name="dateFrom" style="width: 110px">
                        <p class="list">~</p>
                        <input type="text" class="laydate-icon" id="dateTo" name="dateTo"
                               style="width: 110px" onclick="WdatePicker({el:this,dateFmt:'yyyy-MM-dd',onpicked:null})">
                    </div>
                </div>
            </div>
            <div class="searchRight clearfix">
                <shiro:hasPermission name="bigcargostyle:message:view">
                    <!-- 检索 -->
                    <button onclick="searchListForm()">
                        <spring:message code="commom_check" />
                    </button>
                </shiro:hasPermission>
                <!-- 重置 -->
                <button onclick = "clearParam()">
                    <spring:message code="common_reset" />
                </button>

            </div>
        </div>
        <div class="tableArea">
            <div class="tableScrollSm" style="overflow: auto;width: 1690px;height: 714px; ">
                <table cellpadding="0" class="tableHead">
                    <thead>
                    <tr>
                        <!-- No. -->
                        <th><p class="table-No">
                            <spring:message code="common_no" />
                        </p></th>
                        <!-- 款式图片 -->
                        <th><p class="width-80px">
                            <spring:message code="slopwork_style_stylePictures" />
                        </p></th>
                        <!-- 款号/款式名称 -->
                        <th><p class="width-230px">
                            <spring:message code="slopwork_no_name" />
                        </p></th>
                        <!-- 款式类别 -->
                        <th><p class="width-140px">
                            <spring:message code="slopwork_styleCategory" />
                        </p></th>
                        <!-- 年份季节 -->
                        <th><p class="width-140px">
                            <spring:message code="slopwork_style_yearAndSeason" />
                        </p></th>
                        <!-- 客户 -->
                        <th><p class="width-230px">
                            <spring:message code="slopwork_customerName" />
                        </p></th>
                        <!-- 库存数量 -->
                        <th><p class="width-230px">
                            <spring:message code="slopwork_clothsQuantity" />
                        </p></th>
                        <!-- 创建者 -->
                        <th><p class="width-140px">
                            <spring:message code="slopwork_creater" />
                        </p></th>
                        <!-- 创建日期 -->
                        <th><p class="width-140px">
                            <spring:message code="slopwork_create_date" />
                        </p></th>
                    </tr>
                    </thead>
                </table>
                <table cellpadding="0" class="tableBody">
                    <tbody id="listHtml">
                    </tbody>
                </table>
            </div>
        </div>
    </div>
    <div id="paging"></div>
</div>
<script type="text/javascript">
    $(document).ready(function() {
        // 下拉选框带搜索功能
        $("#styleCateGoryCd").select2();
        searchListForm();
    });
</script>
</body>
</html>
